@import (once) "../../include/vars";
@import (once) "../../include/mixins";

:root {
    --v-menu-border-color: #e9e9e9;
    --v-menu-divider-color: #e9e9e9;
    --v-menu-background: #ffffff;
    --v-menu-title-color: #515151;
    --v-menu-color: #191919;
    --v-menu-item-color: #191919;
    --v-menu-item-color-disabled: #ccc;
    --v-menu-item-color-hover: #000000;
    --v-menu-item-background-hover: #e8e8e8;
    --v-menu-dropdown-toogle-color: #191919;
    --v-menu-shadow-color: #e1e1e1;
    --v-menu-border-radius: 4px;
}

.dark-side {
    --v-menu-border-color: #404959;
    --v-menu-divider-color: #404959;
    --v-menu-background: #11151d;
    --v-menu-title-color: #ffffff;
    --v-menu-color: #ffffff;
    --v-menu-item-color: #dbdfe7;
    --v-menu-item-color-disabled: #173e8f;
    --v-menu-item-color-hover: #ffffff;
    --v-menu-item-background-hover: #222938;
    --v-menu-dropdown-toogle-color: #ffffff;
    --v-menu-shadow-color: #191919;
    --v-menu-border-radius: 4px;
}


.v-menu, .v-menu ul {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 4px 0;
    list-style: none inside none;
    background-color: var(--v-menu-background);
    color: var(--v-menu-color);
    border: 1px solid var(--v-menu-border-color);
    display: block;

    &.open {
        display: block!important;
    }

    &.place-right {
        left: auto;
        right: 0;
    }
}

.v-menu {
    li, a {
        position: relative;
    }

    li {
        display: block;
        margin: 0 4px;
    }

    a {
        display: flex;
        align-items: center;
        font-size: 13px;
        color: var(--d-menu-item-color);
        text-decoration: none;
        padding: 4px 10px 4px 32px;
        border-radius: var(--d-menu-border-radius);
        white-space: nowrap;
        flex-wrap: nowrap;
        line-height: 20px;

        &:hover {
            color: var(--d-menu-item-color-hover);
            text-decoration: none;
            background-color: var(--d-menu-item-background-hover);
        }
    }

    .caption {
        margin-right: 1rem;
        white-space: nowrap;
    }

    .hotkey {
        margin-left: auto;
        margin-right: 1rem;
    }

    .icon {
        position: absolute;
        left: 8px;
        top: 5px;
        width: 16px;
        height: 16px;
        font-size: 16px;
    }

    .menu-title {
        background-color: var(--v-menu-background);
        color: var(--v-menu-title-color);
        font-size: 12px;
        line-height: 22px;
        height: 22px;
        padding: 0 8px;
        border: 0;
        font-weight: bold;
        pointer-events: none;

        &:first-child {
            margin: 0;
            border-top-width: 0;
            &:hover {
                border-top-width: 0;
            }
        }
        &:hover {
            background-color: var(--v-menu-background);
            cursor: default;
            border: 0;
        }
    }

    .dropdown-caret {
        margin-left: auto;
    }
    
    .divider {
        padding: 0;
        height: 1px;
        margin: 4px 0;
        overflow: hidden;
        background-color: var(--d-menu-divider-color);
        cursor: default;
        pointer-events: none;
        &:hover {
            background-color: var(--d-menu-divider-color);
        }
    }

    .disabled {
        cursor: default;
        pointer-events: none;
        a {
            color: var(--d-menu-item-color-disabled)!important;
        }
    }
}

.v-menu {
    .v-menu, ul {
        border: none;
        margin: 0 -4px;
    }
}